#! /bin/sh

name=gettext
repology_srcname=gettext
version=0.24.1
revision=1
tarball_url="https://ftp.gnu.org/gnu/gettext/gettext-${version}.tar.xz"
tarball_blake2b="248960052c6f54aa9bc4c3b43822e7353d64152480103ced9e02c2abf298d3e7b48a69c0c03a6c61a76299cfcd0f6ed01e9d5c250f7d41cf21b20b0074eea5a3"
hostdeps="gcc pkg-config"
deps="core-libs"

prepare() {
    autotools_recursive_regen
}

configure() {
    autotools_configure
}

build() {
    make -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" make install

    # Remove conflicting libintl files
    rm -f "${dest_dir}${prefix}"/include/libintl.h
    rm -f "${dest_dir}${prefix}"/lib/libintl.so*
    rm -f "${dest_dir}${prefix}"/share/locale/locale.alias

    post_package_strip
}
